new Vue({
    el: '.container',
    data() {
        return {
            username: null,
            password: null,
            tip: '登录'
        }
    },
    methods: {
        login() {
            console.log(this.username, this.password)
            this.tip = '登录中'
            axios({
                url: '../sign_in',
                method: "POST",
                params: {
                    username: this.username,
                    password: this.password
                }
            }).then(res => {
                if (res.data === 0 || res.data) {
                    this.tip = '登录成功'
                    setTimeout(() => {
                        window.open('../','_self')
                    })
                } else {
                    this.tip = '登录失败'
                }
            }).catch(err => {
                this.tip = '登录失败'
            })
        }
    }
})